#ifndef		_SYSTEM_h_
#define     _SYSTEM_h_

#include "cmsis_os.h"
#include "Fifo.h"

#ifndef inline
#define inline __inline
#endif
typedef   signed          char int8_t;
typedef   signed short     int int16_t;
typedef   signed           int int32_t;
typedef   signed       __int64 int64_t;

    /* exact-width unsigned integer types */
typedef unsigned          char uint8_t;
typedef unsigned short     int uint16_t;
typedef unsigned           int uint32_t;
typedef unsigned       __int64 uint64_t;

typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;

typedef unsigned          char uchar;
typedef unsigned short     int ushort;
typedef unsigned           int uint;

typedef unsigned           int ulong;
typedef unsigned char UCHAR, *PUCHAR;
typedef unsigned char byte, *pbyte;
typedef unsigned char BYTE, *PBYTE;

typedef short SHORT, *PSHORT;
typedef unsigned short ushort, *pushort;
typedef unsigned short USHORT, *PUSHORT;
typedef unsigned short word, *pword;
typedef unsigned short WORD, *PWORD;

typedef long LONG, *PLONG;
typedef unsigned long ULONG, *PULONG;
typedef unsigned long dword, *pdword;
typedef unsigned long DWORD, *PDWORD;

#ifndef ON
#define ON 		1
#endif

#ifndef OFF
#define OFF     0
#endif

#ifndef FALSE
#define FALSE   (0)
#endif

#ifndef TRUE
#define TRUE    (1)
#endif

#ifndef False
#define False   (0)
#endif

#ifndef True
#define True    (1)
#endif

#ifndef Bool
#define Bool uint8_t
#endif

#ifndef HIGH
#define HIGH 1
#endif

#ifndef LOW
#define LOW   0
#endif

#define Delay(nCount)                       osDelay(nCount)
extern Bool IsUart6Rx;
extern Bool IsIt6801IrqTrig;

#define DEBUG 1

#if DEBUG

extern BOOL IsUICtrl;

#define DebugPrintf(fmt, ...)         \
do {                    \
    if(!IsUICtrl) {                \
        printf("[%.3f]"__FILE__",%d,[%s]:"fmt"\n", GetSysMs(), __LINE__, __func__, ##__VA_ARGS__);   \
    }                \
} while (0)

#else
    #define  debug_printf(fmt, ...)
#endif

#endif
/*********************************************************************************************************
**                            End Of programcode_iap
********************************************************************************************************/


